object dm: Tdm
  OldCreateOrder = False
  Height = 465
  Width = 612
  object sClass: TDataSource
    DataSet = tClass
    Left = 10
    Top = 5
  end
  object sSubject: TDataSource
    DataSet = qSubject
    Left = 68
    Top = 5
  end
  object sTeacher: TDataSource
    DataSet = tTeacher
    Left = 126
    Top = 5
  end
  object sRoom: TDataSource
    DataSet = qRoom
    Left = 184
    Top = 5
  end
  object sTutorArrange: TDataSource
    DataSet = tTutorArrange
    Left = 284
    Top = 10
  end
  object sDetail: TDataSource
    DataSet = tDetail
    Left = 374
    Top = 10
  end
  object MySQL94: TMyConnection
    Database = 'timetable'
    Options.UseUnicode = True
    Options.Charset = 'utf8'
    Username = 'khnteacher2011'
    Password = '4966devi@KHN'
    Server = '10.33.19.95'
    Connected = True
    LoginPrompt = False
    Left = 152
    Top = 344
  end
  object tClass: TMyTable
    TableName = 'classinfo'
    OrderFields = 'id'
    Connection = MySQL94
    Active = True
    AutoCalcFields = False
    AfterScroll = ttClassAfterScroll
    OnNewRecord = tClassNewRecord
    IndexFieldNames = 'id'
    Left = 8
    Top = 56
    object tClassid: TWideStringField
      FieldName = 'id'
      Origin = 'classinfo.id'
      Size = 3
    end
    object tClassNbr: TIntegerField
      FieldName = 'Nbr'
      Origin = 'classinfo.Nbr'
    end
    object tClass中文: TIntegerField
      FieldName = #20013#25991
      Origin = 'classinfo.'#20013#25991
    end
    object tClass英文: TIntegerField
      FieldName = #33521#25991
      Origin = 'classinfo.'#33521#25991
    end
    object tClass數學: TIntegerField
      FieldName = #25976#23416
      Origin = 'classinfo.'#25976#23416
    end
    object tClass常識: TIntegerField
      FieldName = #24120#35672
      Origin = 'classinfo.'#24120#35672
    end
    object tClass音樂: TIntegerField
      FieldName = #38899#27138
      Origin = 'classinfo.'#38899#27138
    end
    object tClass視藝: TIntegerField
      FieldName = #35222#34269
      Origin = 'classinfo.'#35222#34269
    end
    object tClass體育: TIntegerField
      FieldName = #39636#32946
      Origin = 'classinfo.'#39636#32946
    end
    object tClass普通話: TIntegerField
      FieldName = #26222#36890#35441
      Origin = 'classinfo.'#26222#36890#35441
    end
    object tClass德公: TIntegerField
      FieldName = #24503#20844
      Origin = 'classinfo.'#24503#20844
    end
    object tClass圖書: TIntegerField
      FieldName = #22294#26360
      Origin = 'classinfo.'#22294#26360
    end
    object tClass電腦: TIntegerField
      FieldName = #38651#33126
      Origin = 'classinfo.'#38651#33126
    end
    object tClass備一: TIntegerField
      FieldName = #20633#19968
      Origin = 'classinfo.'#20633#19968
    end
    object tClass備二: TIntegerField
      FieldName = #20633#20108
      Origin = 'classinfo.'#20633#20108
    end
    object tClass備三: TIntegerField
      FieldName = #20633#19977
      Origin = 'classinfo.'#20633#19977
    end
    object tClass備四: TIntegerField
      FieldName = #20633#22235
      Origin = 'classinfo.'#20633#22235
    end
    object tClass備五: TIntegerField
      FieldName = #20633#20116
      Origin = 'classinfo.'#20633#20116
    end
    object tClass行政: TIntegerField
      FieldName = #34892#25919
      Origin = 'classinfo.'#34892#25919
    end
    object tClassMaxNbr: TIntegerField
      FieldName = 'MaxNbr'
      Origin = 'classinfo.MaxNbr'
    end
    object tClassSchYear: TIntegerField
      FieldName = 'SchYear'
      Origin = 'classinfo.SchYear'
    end
  end
  object qSubject: TMyTable
    TableName = 'subject'
    Connection = MySQL94
    Active = True
    Left = 64
    Top = 56
    object qSubjectid: TLargeintField
      AutoGenerateValue = arAutoInc
      FieldName = 'id'
      Origin = 'subject.id'
    end
    object qSubjectcode: TWideStringField
      FieldName = 'code'
      Origin = 'subject.code'
      Size = 2
    end
    object qSubjectname: TWideStringField
      FieldName = 'name'
      Origin = 'subject.name'
      Size = 8
    end
  end
  object tTeacher: TMyTable
    TableName = 'teacher'
    Connection = MySQL94
    Active = True
    IndexFieldNames = 'LastYear; id'
    Left = 128
    Top = 56
    object tTeachercode: TWideStringField
      FieldName = 'code'
      Origin = 'teacher.code'
      Size = 2
    end
    object tTeachername: TWideStringField
      FieldName = 'name'
      Origin = 'teacher.name'
      Size = 8
    end
    object tTeacherid: TLargeintField
      FieldName = 'id'
      Origin = 'teacher.id'
    end
    object tTeachernbr: TLargeintField
      FieldName = 'nbr'
      Origin = 'teacher.nbr'
    end
    object tTeacherLastYear: TLargeintField
      FieldName = 'LastYear'
      Origin = 'teacher.LastYear'
    end
  end
  object qRoom: TMyTable
    TableName = 'room'
    Connection = MySQL94
    Left = 184
    Top = 56
    object qRoomid: TLargeintField
      AutoGenerateValue = arAutoInc
      FieldName = 'id'
      Origin = 'room.id'
    end
    object qRoomcode: TWideStringField
      FieldName = 'code'
      Origin = 'room.code'
      Size = 4
    end
    object qRoomname: TWideStringField
      FieldName = 'name'
      Origin = 'room.name'
      Size = 10
    end
  end
  object tTutorArrange: TMyTable
    TableName = 'tutorarrange'
    Connection = MySQL94
    BeforePost = ttTutorArrangeBeforePost
    AfterPost = ttTutorArrangeAfterPost
    BeforeDelete = ttTutorArrangeBeforeDelete
    AfterDelete = ttTutorArrangeAfterPost
    OnFilterRecord = tTutorArrangeFilterRecord
    OnNewRecord = tClassNewRecord
    IndexFieldNames = 'ClassID; SubjID'
    Left = 288
    Top = 64
    object tTutorArrangeClassID: TWideStringField
      FieldName = 'ClassID'
      Origin = 'tutorarrange.ClassID'
      Size = 3
    end
    object tTutorArrangeSubjID: TLargeintField
      FieldName = 'SubjID'
      Origin = 'tutorarrange.SubjID'
    end
    object tTutorArrangeSubjName: TWideStringField
      FieldName = 'SubjName'
      Origin = 'tutorarrange.SubjName'
      Size = 8
    end
    object tTutorArrangeTchrID: TWideStringField
      FieldName = 'TchrID'
      Origin = 'tutorarrange.TchrID'
      Size = 8
    end
    object tTutorArrangeRoomID: TWideStringField
      FieldName = 'RoomID'
      Origin = 'tutorarrange.RoomID'
      Size = 8
    end
    object tTutorArrangeNbr: TLargeintField
      FieldName = 'Nbr'
      Origin = 'tutorarrange.Nbr'
    end
    object tTutorArrangeRoomStr: TStringField
      FieldKind = fkLookup
      FieldName = 'RoomStr'
      LookupDataSet = qRoom
      LookupKeyFields = 'code'
      LookupResultField = 'name'
      KeyFields = 'RoomID'
      Lookup = True
    end
    object tTutorArrangeSubj: TStringField
      FieldKind = fkLookup
      FieldName = 'Subj'
      LookupDataSet = qSubject
      LookupKeyFields = 'id'
      LookupResultField = 'code'
      KeyFields = 'SubjID'
      Lookup = True
    end
    object tTutorArrangeTchr: TStringField
      FieldKind = fkLookup
      FieldName = 'Tchr'
      LookupDataSet = tTeacher
      LookupKeyFields = 'id'
      LookupResultField = 'name'
      KeyFields = 'TchrID'
      Lookup = True
    end
    object tTutorArrangeTchrCode: TStringField
      FieldKind = fkLookup
      FieldName = 'TchrCode'
      LookupDataSet = tTeacher
      LookupKeyFields = 'id'
      LookupResultField = 'code'
      KeyFields = 'TchrID'
      Lookup = True
    end
    object tTutorArrangeSchYear: TLargeintField
      FieldName = 'SchYear'
    end
  end
  object tDetail: TMyTable
    TableName = 'tutorarrangedetail'
    Connection = MySQL94
    BeforePost = tDetailBeforePost
    OnNewRecord = tClassNewRecord
    Left = 376
    Top = 64
    object tDetailid: TLargeintField
      AutoGenerateValue = arAutoInc
      FieldName = 'id'
      Origin = 'tutorarrangedetail.id'
    end
    object tDetailClassCode: TWideStringField
      FieldName = 'ClassCode'
      Origin = 'tutorarrangedetail.ClassCode'
      Size = 3
    end
    object tDetailSubjectID: TLargeintField
      FieldName = 'SubjectID'
      Origin = 'tutorarrangedetail.SubjectID'
    end
    object tDetailSubjectCode: TWideStringField
      FieldName = 'SubjectCode'
      Origin = 'tutorarrangedetail.SubjectCode'
      Size = 2
    end
    object tDetailTeacherID: TLargeintField
      FieldName = 'TeacherID'
      Origin = 'tutorarrangedetail.TeacherID'
    end
    object tDetailTeacherCode: TWideStringField
      FieldName = 'TeacherCode'
      Origin = 'tutorarrangedetail.TeacherCode'
      OnChange = tDetailTeacherCodeChange
      Size = 2
    end
    object tDetailRoomCode: TWideStringField
      FieldName = 'RoomCode'
      Origin = 'tutorarrangedetail.RoomCode'
      Size = 4
    end
    object tDetailNbr: TWideStringField
      FieldName = 'Nbr'
      Origin = 'tutorarrangedetail.Nbr'
      Size = 1
    end
    object tDetailDayCode: TLargeintField
      FieldName = 'DayCode'
      Origin = 'tutorarrangedetail.DayCode'
    end
    object tDetailLessonCode: TLargeintField
      FieldName = 'LessonCode'
      Origin = 'tutorarrangedetail.LessonCode'
    end
    object tDetailFlag: TBooleanField
      FieldName = 'Flag'
      Origin = 'tutorarrangedetail.Flag'
    end
    object tDetailExLesson: TLargeintField
      FieldName = 'ExLesson'
      Origin = 'tutorarrangedetail.ExLesson'
    end
    object tDetailSchYear: TLargeintField
      FieldName = 'SchYear'
    end
  end
  object qTeacherNbr: TMyQuery
    Connection = MySQL94
    SQL.Strings = (
      'SELECT SUM(Nbr) AS NbrTotal'
      'FROM TutorArrange'
      'WHERE'
      '(TchrID = :vTeacher)')
    Left = 312
    Top = 168
    ParamData = <
      item
        DataType = ftString
        Name = 'vTeacher'
      end>
  end
  object qTeacherList: TMyQuery
    Connection = MySQL94
    SQL.Strings = (
      
        'SELECT distinct Code as TeacherCode FROM `timetable`.`teacher` w' +
        'here (LastYear >= :LastYear)')
    Left = 360
    Top = 360
    ParamData = <
      item
        DataType = ftInteger
        Name = 'LastYear'
      end>
  end
end
